﻿using System;
using System.Collections.Generic;
using System.Text;

namespace _07_构造函数的相互调用
{
     class Production
    {
        /// <summary>
        /// 产品类
        /// </summary>
        public Guid ProductID { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        public string ProductName { get; set; }

        /// <summary>
        /// 生产日期
        /// </summary>
        public DateTime ProductDate { get; set; }

        /// <summary>
        /// 带三个参数的构造函数
        /// </summary>
        /// <param name="pid">产品编号</param>
        /// <param name="panme">产品名称</param>
        /// <param name="pdate">生产日期</param>
        public Production(Guid pid,string panme,DateTime pdate)
        {
            ProductID = pid;
            ProductName = panme;
            ProductDate = pdate;
        }


        /// <summary>
        /// 带两个参数的构造函数
        /// </summary>
        /// <param name="pname">产品名称</param>
        /// <param name="pdate">生产日期</param>
        public Production(string pname, DateTime pdate)
            : this(Guid.NewGuid(), pname, pdate)
        { }

        /// <summary>
        /// 不带参数的构造函数
        /// </summary>
        public Production()
            : this(Guid.NewGuid(), "未知产品", DateTime.Today) { }

    }
}
